﻿<Window x:Class="SqlPermissionsAuditor.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:SqlPermissionsAuditor="clr-namespace:SqlPermissionsAuditor"
        Title="MainWindow" Height="464" Width="693"
        x:Name="_this">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <GroupBox Header="Run for which users?" Height="169" HorizontalAlignment="Left" Margin="7,234,0,0" Name="groupBox1" VerticalAlignment="Top" Width="195">
            <Grid Height="143">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="32*" />
                    <ColumnDefinition Width="122*" />
                    <ColumnDefinition Width="29*" />
                </Grid.ColumnDefinitions>
                <RadioButton Content="Use the current user" Height="21" HorizontalAlignment="Left" Margin="17,15,0,0" Name="rdoCurrentUser" VerticalAlignment="Top" Width="143" Grid.ColumnSpan="3" GroupName="userOptions" />
                <RadioButton Content="Impersonate all db users" Height="21" HorizontalAlignment="Left" Margin="17,42,0,0" Name="rdoAllDbUsers" VerticalAlignment="Top" Width="160" Grid.ColumnSpan="3" GroupName="userOptions" IsChecked="True" />
                <Button Content="Generate Script" Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="50,117,0,0" Name="btnGenerateScript" VerticalAlignment="Top" Width="96" Click="btnGenerateScript_Click" Grid.ColumnSpan="2">
                    <Button.ToolTip>
                        <ToolTip>
                            <StackPanel>
                                <TextBlock FontWeight="Bold">Submit Request</TextBlock>
                                <TextBlock>Submits the request to the server.</TextBlock>
                            </StackPanel>
                        </ToolTip>
                    </Button.ToolTip>
                </Button>
                <CheckBox Content="Show Integrated Logins" Grid.ColumnSpan="2" Height="16" HorizontalAlignment="Left" Margin="19,69,0,0" Name="chkWindowsLogins" VerticalAlignment="Top" IsChecked="True" />
                <CheckBox Content="Show SQL Logins" Grid.ColumnSpan="2" Height="16" HorizontalAlignment="Left" Margin="19,0,0,29" Name="chkSqlLogins" VerticalAlignment="Bottom" IsChecked="True" />
            </Grid>
        </GroupBox>
        <SqlPermissionsAuditor:SqlConnectionStringBuilder ConnectionString="{Binding ElementName=_this, Path=Test}" Margin="0,0,0,181" x:Name="ConnectionStringBuilder" />
        <TextBlock Text="{Binding ElementName=_this, Path=Test, StringFormat='Produced Connection String: {0}'}"
                   Grid.Row="1" />
        <GroupBox Header="Users" Height="160" HorizontalAlignment="Left" Margin="313,243,0,0" Name="groupBox2" VerticalAlignment="Top" Width="307">
            <Grid>
                <ListBox ItemsSource="{Binding AvailablePresentationObjects}" Name="lstUsers">
                    <ListBox.ItemTemplate>
                        <HierarchicalDataTemplate>
                            <CheckBox Content="{Binding Name}" IsChecked="{Binding IsChecked}"/>
                        </HierarchicalDataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </Grid>
        </GroupBox>
    </Grid>

</Window>
